package com.broada.apm.topo;

import com.broada.apm.model.Service;

public class SrcService {
	private String srcIp;
	private Service service;
	
	public SrcService(String srcIp, Service service) {
		super();
		this.srcIp = srcIp;
		this.service = service;
	}
	
	public String getSrcIp() {
		return srcIp;
	}
	public void setSrcIp(String srcIp) {
		this.srcIp = srcIp;
	}
	public Service getService() {
		return service;
	}
	public void setService(Service service) {
		this.service = service;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SrcService other = (SrcService) obj;
		if (srcIp == null) {
			if (other.srcIp != null)
				return false;
		} else if (!srcIp.equals(other.srcIp))
			return false;
		else if(service!=null && !service.getId().equals(other.service.getId()))
			return false;
		return true;
	}
}
